<script type="text/javascript" src="<?=base_url()?>resource/js/layer/layer.js"></script>
<script type="text/javascript">
    $(function(){
        $('#order_num').focus();
    });
    //全选/全不选
    function CheckAll(){
        var checkAll=$('#checkAll').is(':checked');
        if(checkAll){
            $("input[name='ids[]']").each(function(){
                $(this).prop("checked",true);
            });
        }else{
            $("input[name='ids[]']").each(function(){
                $(this).prop("checked",false);
            });
        }
    }
    function sub(){
        var idsCk=$("input[name='ids[]']").is(':checked');
        if(!idsCk){
            alert('Please select a data');
            return false;
        }
    }
    function searchScan(){
        var order_num= $("#order_num").val();
        if(order_num==''){
            alert('data null');
            return false;
        }
    }
</script>


<!--菜单 start-->
<?php $this->load->view('defaults/common/left');?>
<!--菜单 end-->
<div id="content">
    <div class="page-header">
        <div class="container-fluid">
          <h1><?=lang('menu_ddgl')?></h1>
          <?=$this->breadcrumb->generateHTML();?>
        </div>
    </div>
    <div class="container-fluid">
        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title"><i class="fa fa-search"></i><?=lang('menu_shsm')?></h3>
          </div>
          <div class="panel-body">
            <div class="well" style="padding:0 19px;">
              <div class="row">
                <form action="<?=blang_url('orders/ReceivingScan/productScanList')?>">
                    <div class="col-sm-4">
                        <div class="form-group">
                            <label class="control-label" for="input-name">orderId</label>
                            <input class="form-control" id="order_num" name="order_num" placeholder="orderId">
                        </div>
                    </div>
                    <div class="col-sm-8">
                        <div class="form-group" style="padding-top:37px;">
                            <input class="btn btn-primary" type="submit" value=" search " onclick="searchScan()">
                        </div>
                    </div>
                </form>
              </div>
            </div>
            <div class="table-responsive">
                <form action="<?=blang_url('orders/ReceivingScan/productReceiving')?>">
                <table class="table table-bordered table-hover oms-table">
                  <thead>
                    <tr>
                        <th class="text-left"><input type="checkbox" id="checkAll" onclick="CheckAll()">select</th>
                        <th class="text-left">id</th>
                        <th class="text-left">Brand</th>
                        <th class="text-left">Model</th>
                        <th class="text-right">Attribute</th>
                        <th class="text-right">SKU</th>
                        <th class="text-right">IMEI</th>
                        <th class="text-right">Status</th>
                    </tr>
                  </thead>
                  <tbody>
                    <?php if($productList): foreach ($productList as $key=>$row):?>
                    <tr>
                        <td class="text-left"><input name="ids[]" value="<?=$row['id']?>" type="checkbox" <?=$row['status_id']==1?'':'disabled'?> ></td>
                        <td class="text-left"><?=$row['id']?></td>
                        <td class="text-left"><?=$row['product_brand']?></td>
                        <td class="text-left"><?=$row['product_model']?></td>
                        <td class="text-right"><?php $attributes=json_decode($row['attributes'],true);echo $attributes['sku_name'];?></td>
                        <td class="text-right"><?=$row['productSku']?></td>
                        <td class="text-right"><?=$row['imei']?></td>
                        <td class="text-right"><?=$row['status_id']==18?"<a class='btn btn-oms btn-sm' href='".blang_url('products/Product_new/unpackQc/'.$row['id'])."'>".lang('order_cbzj')."</a>":$row['status_name']?></td>
                    </tr>

                    <?php endforeach;?>
                    <tr>
                        <td colspan="8">
                            <input type="hidden" value="<?=$order_num?>" name="order_num">
                            <input class="btn btn-primary" style="padding:8px 40px;" type="submit" value=" <?=lang('order_sh')?> " onclick="return sub()">
                        </td>
                    </tr>
                    <?php else:?>
                        <tr><td colspan="8" class="emptyNumber"><?=lang('public_mygdsj')?>....</td></tr>
                    <?php endif; ?>
                </tbody>
                </table>
                </form>
               
            </div>
          </div>
        </div>
    </div>


</div>





